<?php
namespace app\test\controller;
use think\Db;
use think\Controller;
class Product extends Controller
{
    public function index()
    {
    	$list=db('dachang_product')->select();
    	//dump($list);die;
    	$this->assign('list',$list);

      return view('./test1/product');
    }
    public function ajax()
    {
    	$product_id=$_POST['product_id'];
    	$data=[
    		'product_id'=>$product_id,
    		'product_num'=>'1'
    	];

    	$result=db('dachang_shopcart')->insert($data);
    	echo json_encode($result);
    }
    public function ttst()
    {
        echo "hello world";
    }
}